package svgedit.gui;

import java.io.File;
import javax.swing.filechooser.FileFilter;

/**
 * Provides filtering for file chooser dialogs to select SVG files. Accepts only
 * files with the {@literal .svg} extension, ignoring case.
 */
public class SVGFileFilter extends FileFilter
{

	/**
	 * Specify the file type to filter. Only includes directories and files
	 * ending in .svg
	 */
	@Override
	public boolean accept(File file)
	{
		if (file.isDirectory())
		{
			return true;
		}
		return file.getName().toLowerCase().endsWith(".svg");
	}

	/**
	 * Specify the description
	 */
	@Override
	public String getDescription()
	{
		return "SVG Files";
	}
}
